package controller.admin;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Kv;

import controller.admin.base.BaseAdminController;
import enums.UnbindStatus;
import service.ServicerCompanyService;
import service.UnbindService;

public class AdminUnbindController extends BaseAdminController {
	@Inject UnbindService unbindService ;
	@Inject ServicerCompanyService servicerCompanyService ;
	
	public void list() {
	    Kv kv = getParamKv() ;
	    Integer pageNumber = getParaToInt("pageNumber", 1);
	    Integer pageSize = getParaToInt("pageSize", 10);
	    set("page", unbindService.getPage( kv , pageNumber, pageSize));
	    set("unbindStatusList", UnbindStatus.toList());
	    renderJson();
	}
	
	public void audit() {
		Long id = getParaToLong("id");
		Integer status = getParaToInt("status" , UnbindStatus.getPass() );
		renderJson( servicerCompanyService.remove(id , status ) );
	}
}
